package com.zlm.IO.CharStream.BufferedStream;

import java.io.*;

/**
 * @author 13026
 */
public class BufferedStream_demo {
    /*
     * 字符缓冲流
     * BufferedReader BufferedWriter
     *
     * BufferedReader
     * public String readLine() 读取一行数据，没有返回null
     *
     * BufferedWriter
     * public void newLine()    跨平台换行
     * */
    public static void main(String[] args) throws IOException {
        // 一次操作一个字节
        BufferedReader br = new BufferedReader(new FileReader("D:\\myProject\\javaTest\\oneModule\\src\\com\\zlm\\IO\\CharStream\\BufferedStream\\FilesPackage\\a.txt"));
        BufferedWriter bw = new BufferedWriter(new FileWriter("D:\\myProject\\javaTest\\oneModule\\src\\com\\zlm\\IO\\CharStream\\BufferedStream\\FilesPackage\\a_copy.txt"));

        String s;
        while ((s = br.readLine()) != null) {
            bw.write(s);
            bw.newLine();
        }
        bw.close();
        br.close();
    }
}
